/* Drag Contexts */
static GdkDragContext *
-gdk_drag_context_new (void)
+gdk_drag_context_new (GdkDisplay *display)
{
GdkWin32DragContext *context_win32;
GdkDragContext *context;
context_win32 = g_object_new (GDK_TYPE_WIN32_DRAG_CONTEXT, NULL);
context = GDK_DRAG_CONTEXT(context_win32);
+ gdk_drag_context_set_device (context, gdk_seat_get_pointer (gdk_display_get_default_seat (display)));
+
return context;
}
* pending GDK event.
*/
static void
-process_pending_events ()
+process_pending_events (GdkDisplay *display)
{
g_main_context_iteration (NULL, FALSE);
- while (_gdk_event_queue_find_first (_gdk_display))
+ while (_gdk_event_queue_find_first (display))
g_main_context_iteration (NULL, FALSE);
}
ctx->context->suggested_action = get_suggested_action (grfKeyState);
dnd_event_put (GDK_DRAG_ENTER, ctx->context, pt, TRUE);
- process_pending_events ();
+ process_pending_events (gdk_device_get_display (gdk_drag_context_get_device (ctx->context)));
*pdwEffect = drop_effect_for_action (ctx->context->action);
/* Assume that target can accept the data: In fact it may fail but
ctx->context->suggested_action = get_suggested_action (grfKeyState);
dnd_event_put (GDK_DRAG_MOTION, ctx->context, pt, TRUE);
- process_pending_events ();
+ process_pending_events (gdk_device_get_display (gdk_drag_context_get_device (ctx->context)));
*pdwEffect = drop_effect_for_action (ctx->context->action);
return S_OK;
GDK_NOTE (DND, g_print ("idroptarget_dragleave %p S_OK\n", This));
dnd_event_put (GDK_DRAG_LEAVE, ctx->context, pt, TRUE);
- process_pending_events ();
+ process_pending_events (gdk_device_get_display (gdk_drag_context_get_device (ctx->context)));
return S_OK;
}
ctx->context->suggested_action = get_suggested_action (grfKeyState);
dnd_event_put (GDK_DROP_START, ctx->context, pt, TRUE);
- process_pending_events ();
+ process_pending_events (gdk_device_get_display (gdk_drag_context_get_device (ctx->context)));
dnd_data = NULL;
GDK_NOTE (DND, g_print ("idropsource_querycontinuedrag %p ", This));
if (send_change_events (ctx->context, grfKeyState, fEscapePressed))
- process_pending_events ();
+ process_pending_events (gdk_device_get_display (gdk_drag_context_get_device (ctx->context)));
if (_dnd_source_state == GDK_WIN32_DND_DROPPED)
{
GDK_NOTE (EVENTS, _gdk_win32_print_event (&e));
gdk_event_put (&e);
- process_pending_events ();
+ process_pending_events (gdk_device_get_display (gdk_drag_context_get_device (ctx->context)));
active_pFormatEtc = NULL;
active_pMedium = NULL;
GdkDragContext *context;
GdkWin32DragContext *context_win32;
target_drag_context *result;
- GdkSeat *seat;
- context = gdk_drag_context_new ();
+ context = gdk_drag_context_new (gdk_window_get_display (window));
context_win32 = GDK_WIN32_DRAG_CONTEXT (context);
result = g_new0 (target_drag_context, 1);
result->context->protocol = GDK_DRAG_PROTO_OLE2;
result->context->is_source = FALSE;
- seat = gdk_display_get_default_seat (_gdk_display);
- gdk_drag_context_set_device (context, gdk_seat_get_pointer (seat));
-
result->context->source_window = NULL;
result->context->dest_window = window;
GdkDragContext *context;
GdkWin32DragContext *context_win32;
source_drag_context *result;
- GdkSeat *seat;
- context = gdk_drag_context_new ();
+ context = gdk_drag_context_new (gdk_window_get_display (window));
context_win32 = GDK_WIN32_DRAG_CONTEXT (context);
result = g_new0 (source_drag_context, 1);
result->context->protocol = GDK_DRAG_PROTO_OLE2;
result->context->is_source = TRUE;
- seat = gdk_display_get_default_seat (_gdk_display);
- gdk_drag_context_set_device (context, gdk_seat_get_pointer (seat));
-
result->context->source_window = window;
g_object_ref (window);
POINT pt;
gint nfiles, i;
gchar *fileName, *linkedFile;
- GdkSeat *seat;
if (msg->message == WM_DROPFILES)
{
GDK_NOTE (DND, g_print ("WM_DROPFILES: %p\n", msg->hwnd));
- context = gdk_drag_context_new ();
+ context = gdk_drag_context_new (gdk_window_get_display (event->any.window));
context->protocol = GDK_DRAG_PROTO_WIN32_DROPFILES;
context->is_source = FALSE;
- seat = gdk_display_get_default_seat (_gdk_display);
- gdk_drag_context_set_device (context, gdk_seat_get_pointer (seat));
-
context->source_window = gdk_get_default_root_window ();
g_object_ref (context->source_window);
{
GdkEvent *tmp_event;
GdkDragContext *new_context;
- GdkSeat *seat;
GDK_NOTE (DND, g_print ("local_send_enter: context=%p current_dest_drag=%p\n",
context,
current_dest_drag = NULL;
}
- new_context = gdk_drag_context_new ();
+ new_context = gdk_drag_context_new (gdk_window_get_display (context->source_window));
new_context->protocol = GDK_DRAG_PROTO_LOCAL;
new_context->is_source = FALSE;
- seat = gdk_display_get_default_seat (_gdk_display);
- gdk_drag_context_set_device (context, gdk_seat_get_pointer (seat));
-
new_context->source_window = context->source_window;
g_object_ref (new_context->source_window);
if (!use_ole2_dnd)
{
GdkDragContext *new_context;
- GdkSeat *seat;
g_return_val_if_fail (window != NULL, NULL);
- new_context = gdk_drag_context_new ();
-
- seat = gdk_display_get_default_seat (_gdk_display);
- gdk_drag_context_set_device (new_context, gdk_seat_get_pointer (seat));
+ new_context = gdk_drag_context_new (gdk_window_get_display (window));
new_context->is_source = TRUE;
new_context->source_window = window;
g_object_ref (dest_window);
}
else
- dest_window = gdk_win32_window_foreign_new_for_display (_gdk_display, a.result);
+ dest_window = gdk_win32_window_foreign_new_for_display (gdk_screen_get_display (screen), a.result);
if (use_ole2_dnd)
*protocol = GDK_DRAG_PROTO_OLE2;